<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>标题</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/weadmin.css">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<form class="layui-form searchForm" action="" style="padding-left: 20%;">
    聘请人员身份证号码:
    <div class="layui-input-inline">
        <input style="width:200px;" type="text" name="userCard" placeholder="身份证号" autocomplete="off"
               class="layui-input">
    </div>
    <button class="layui-btn" lay-submit lay-filter="formDemo">搜索</button>
    <button class="layui-btn" lay-submit lay-filter="formClear">清空</button>
</form>
<div style="padding:10% 0% 0% 20%;">
    <p>聘用人员的流程：</p>
    <p><img style="width: 70%; margin: 20px 60px 20px 20px" src="pinqing.png"></p>
</div>

<!--
<table class="layui-hide" id="dataList" lay-filter="dataList"></table>
-->

<script type="text/javascript" src="/lib/layui/layui.js"></script>
<script src="/static/js/main.js"></script>
<script>
    layui.use(['jquery', 'configureCom', 'configure', 'table'], function () {
        var $ = layui.jquery;
        var configure = layui.configure;
        var configureCom = layui.configureCom;
        var userCard = {};
        form.on('submit(formDemo)', function (data) {
            userCard = data.field.userCard;//获取搜索框中信息
            configureCom.postDataAjax(configure.COM_SEARCH_QUALI_USER_HTTP, {userCard: userCard}).then(function (res) {
                 top.layer.open({
                     type: 2,
                     title: '人员详情',
                     area: configureCom.Psize1,
                     content: configure.COM_EMPLOY_ZIZHI_USER_DETAIL_HTML+'?userCard='+userCard,
                     btn: ['发起聘请'],
                     yes: function (index, layero) {
                         var iframeWin = top.window.frames['layui-layer-iframe' + index]; //得到iframe页的窗口
                         iframeWin.getData().then(function (res) {
                             console.log(res.result);
                             configureCom.postDataAjax(configure.COM_EMPLOY_ZIZHI_USER_HTTP, res.result).then(function (res) {
                                 top.layer.close(index);
                                 top.layer.closeAll();
                                 top.layer.alert('注意:个人处理需登录个人账号后，在【聘用业务管理】-【企业聘用】中处理', {title: '聘用申请发送成功，请等待。'});
                                 configureCom.tableReload(true);
                             });
                         });
                     }
                 });
                 return false;

            });
            return false;
        });
    });

    function getData() {
        return table.checkStatus('dataList').data[0];
    }

</script>
</body>
</html>